<?php

namespace app\admin\model\website;

use think\Model;


class TeamBuildingVideo extends Model
{

    

    

    // 表名
    protected $name = 'team_building_video';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'type_text',
        'is_top_text'
    ];

    public function getTypeList()
    {
        return [1=>'忆群人团建',2=>'铁血训练营',3=>'海速体育',4=>'院校素拓教育'];
    }
    public function getIsTopList()
    {
        return [1=>'<span style="color:red">[置顶]</span> ',0=>''];
    }

    public function getTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
        $list = $this->getTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }

    public function getIsTopTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_top']) ? $data['is_top'] : '');
        $list = $this->getIsTopList();
        return isset($list[$value]) ? $list[$value] : '';
    }







}
